package alogrithm.tree;

/**
 * TreeNode
 * @author christm
 *
 */
public class Node <T>{
	private Node<T> left;
	private Node<T> right;
	private Node<T> parent;
	private T data;
	
	public Node(T data){
		this.data=data;
		this.left=null;
		this.right=null;
		this.parent=null;
	}
	
	public Node(Node<T> left,Node<T>right,T data){
		this.left=left;
		this.right=right;
		this.data=data;
	}
	
	public Node(Node<T> parent,T data){
		this.parent=parent;
		this.data=data;
	}
	
	public String toString(){
		return String.valueOf(this.data);
	}
	public Node<T> getLeft() {
		return left;
	}
	public void setLeft(Node<T> left) {
		this.left = left;
	}
	public Node<T> getRight() {
		return right;
	}
	public void setRight(Node<T> right) {
		this.right = right;
	}
	public Node<T> getParent() {
		return parent;
	}
	public void setParent(Node<T> parent) {
		this.parent = parent;
	}
	public T getData() {
		return data;
	}
	public void setData(T data) {
		this.data = data;
	}
}
